package table_Mixage;

import java.util.ArrayList;

//Thread de lecture
class Lecture extends Thread {
			
		public boolean work = false;
		private Pause pause;
		private Piste piste;
		private ArrayList<PlayerCanal> canaux;
		private Stop stop;
		private MPlayer mp = new MPlayer();
			
		public void run(){
			int echDebut = (canaux.get(0).graph.positionX*piste.getNbEch())/500;
			int echFin = (canaux.get(0).graph.positionX2*piste.getNbEch())/500;
			if (echFin == 0 || echDebut == echFin){
				echFin = piste.getNbEch();
			}
			mp.play(this.piste,this.pause,this.stop,this.canaux,echDebut,echFin);
		}
			
		//Seteurs
		public void setPause(Pause pause){
			this.pause = pause;
		}
			
		public void setGraph(ArrayList<PlayerCanal> p){
			this.canaux = p;
		}
			
		public void setPiste(Piste piste){
			this.piste = piste;
		}
		public void setStop(Stop stop){
			this.stop = stop;
		}
		//Geteurs
		public Piste getPiste(){
			return this.piste;
		}
		public MPlayer getMP(){
			return this.mp;
		}
}